﻿namespace Resonator.Domain.Models
{
	using System.Collections.Generic;

	public static class Ext
	{
		public static T[] ToArray<T>(ICollection<T> col)
		{
			if( col == null || col.Count == 0 )
			{
				return new T[0];
			}

			T[] array = new T[col.Count];

			int i = 0;
			foreach(T item in col)
			{
				array[i++] = item;
			}

			return array;
		}
	}
}